﻿<UserControl x:Class="TimePunch.Metro.Wpf.Controls.ErrorBar.DisplayErrorBar"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Converter="clr-namespace:TimePunch.Metro.Wpf.Converter" mc:Ignorable="d" 
             x:Name="DisplayErrorCtrl"
             d:DesignHeight="100" d:DesignWidth="300">
	
    <UserControl.Resources>
        <Converter:ObjectToVisibilityConverter x:Key="ObjectToVisibilityConverter" />
	</UserControl.Resources>
	
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Button Grid.Column="0" Style="{StaticResource ChromeButtonStyle}" Margin="{StaticResource WinMargin}" 
                        Visibility="{Binding Command, ElementName=DisplayErrorCtrl, Converter ={StaticResource ObjectToVisibilityConverter}}"
                        Command="{Binding Command, ElementName=DisplayErrorCtrl}">
            <Button.Content>
                <Image Source="/TpMetroWpfLibrary;component/Images/appbar.refresh.png" Stretch="None" />
            </Button.Content>
        </Button>

        <TextBlock Grid.Column="1"
                           Text="{Binding Text, ElementName=DisplayErrorCtrl}" 
                           TextWrapping="Wrap" 
                           VerticalAlignment="Center"
                           Margin="{StaticResource WinMargin}"
                           Style="{StaticResource WinTextAccentStyle}"/>
    </Grid>
</UserControl>
